# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=mbelib
pkgver=1.3.0
pkgrel=2
pkgdesc="Voice codecs for P25, ProVoice, Half Rate"
arch=('loong64' 'x86_64')
url="https://github.com/szechyjs/mbelib"
license=('MIT')
depends=('glibc')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('1148b2c2e6e26f92e2d9643a79dc7ed3616e5903268b0a970d97abc9aff9a19241f037f82814109a247251796c652287c557e04dd1da2d827fd068534ac20a99')

build() {
  mkdir -p "$srcdir"/$pkgname-$pkgver/build
  cd "$srcdir"/$pkgname-$pkgver/build

  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr 

  make
}

package() {
  cd "$srcdir"/$pkgname-$pkgver/build

  make DESTDIR="$pkgdir" install

  install -Dm644 ../COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
